import { dom } from "./dom.js"
export const _option = (value, label, selected) => {
    return dom.option(value, {
      value: value,
      // label: label,
      selected: selected ? true : undefined
    })
  }
  export const _select = (val, options) => {
    // debugger
    let children = options.options.map(t => _option(t.value, t.label, val === t.value))
    // console.log(children)
    // children=[]
    delete options.label
    let select = dom.select(children, {
      
      class: 'select',
      ...options,
    })
    return select
  }